<!DOCTYPE html>
<html class="client-nojs vector-feature-night-mode-disabled vector-feature-language-in-header-enabled vector-feature-language-in-main-page-header-disabled vector-feature-page-tools-pinned-disabled vector-feature-toc-pinned-clientpref-1 vector-feature-main-menu-pinned-disabled vector-feature-limited-width-clientpref-1 vector-feature-limited-width-content-enabled vector-feature-custom-font-size-clientpref-1 vector-feature-appearance-pinned-clientpref-1 vector-sticky-header-enabled" lang="en" dir="ltr"><head>
<meta charset="UTF-8">
<title>Preprocessor</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="canonical" href="https://en.wikipedia.org/wiki/Preprocessor"> <link href="./mw/ext.cite.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/skins.vector.icons.css" rel="stylesheet" type="text/css">
<link href="./mw/skins.vector.search.codex.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/skins.vector.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/user.styles.css" rel="stylesheet" type="text/css">
<meta name="ResourceLoaderDynamicStyles" content="">
<link rel="stylesheet" type="text/css" href="./mw/site.styles.css">
<link rel="stylesheet" type="text/css" href="./mw/noscript.css">
<link rel="stylesheet" type="text/css" href="./footer.css">
<link rel="stylesheet" type="text/css" href="./vector-2022.css">
</head>
<body class="skin--responsive skin-vector skin-vector-search-vue mediawiki ltr sitedir-ltr mw-hide-empty-elt ns-0 ns-subject page-Preprocessor rootpage-Preprocessor skin-vector-2022 action-view">
<div class="mw-page-container">
<div class="mw-page-container-inner">
<div class="mw-content-container">
<main id="content" class="mw-body">
<header class="mw-body-header vector-page-titlebar">
<h1 id="firstHeading" class="firstHeading mw-first-heading">
<span id="openzim-page-title" class="mw-page-title-main"><span class="mw-page-title-main">Preprocessor</span></span>
</h1>
</header>
<a id="top"></a>
<div id="bodyContent" class="vector-body ve-init-mw-desktopArticleTarget-targetContainer" aria-labelledby="firstHeading" data-mw-ve-target-container="">
<div id="mw-content-text" class="mw-body-content mw-content-ltr" lang="en" dir="ltr"><div class="mw-content-ltr mw-parser-output" lang="en" dir="ltr">
<style data-mw-deduplicate="TemplateStyles:r1251242444">
/* start https://en.wikipedia.org/ */
.mw-parser-output .ambox{border:1px solid #a2a9b1;border-left:10px solid #36c;background-color:#fbfbfb;box-sizing:border-box}.mw-parser-output .ambox+link+.ambox,.mw-parser-output .ambox+link+style+.ambox,.mw-parser-output .ambox+link+link+.ambox,.mw-parser-output .ambox+.mw-empty-elt+link+.ambox,.mw-parser-output .ambox+.mw-empty-elt+link+style+.ambox,.mw-parser-output .ambox+.mw-empty-elt+link+link+.ambox{margin-top:-1px}html body.mediawiki .mw-parser-output .ambox.mbox-small-left{margin:4px 1em 4px 0;overflow:hidden;width:238px;border-collapse:collapse;font-size:88%;line-height:1.25em}.mw-parser-output .ambox-speedy{border-left:10px solid #b32424;background-color:#fee7e6}.mw-parser-output .ambox-delete{border-left:10px solid #b32424}.mw-parser-output .ambox-content{border-left:10px solid #f28500}.mw-parser-output .ambox-style{border-left:10px solid #fc3}.mw-parser-output .ambox-move{border-left:10px solid #9932cc}.mw-parser-output .ambox-protection{border-left:10px solid #a2a9b1}.mw-parser-output .ambox .mbox-text{border:none;padding:0.25em 0.5em;width:100%}.mw-parser-output .ambox .mbox-image{border:none;padding:2px 0 2px 0.5em;text-align:center}.mw-parser-output .ambox .mbox-imageright{border:none;padding:2px 0.5em 2px 0;text-align:center}.mw-parser-output .ambox .mbox-empty-cell{border:none;padding:0;width:1px}.mw-parser-output .ambox .mbox-image-div{width:52px}@media(min-width:720px){.mw-parser-output .ambox{margin:0 10%}}@media print{body.ns-0 .mw-parser-output .ambox{display:none!important}}
/* end https://en.wikipedia.org/ */
</style>
<style data-mw-deduplicate="TemplateStyles:r1129693374">
/* start https://en.wikipedia.org/ */
.mw-parser-output .hlist dl,.mw-parser-output .hlist ol,.mw-parser-output .hlist ul{margin:0;padding:0}.mw-parser-output .hlist dd,.mw-parser-output .hlist dt,.mw-parser-output .hlist li{margin:0;display:inline}.mw-parser-output .hlist.inline,.mw-parser-output .hlist.inline dl,.mw-parser-output .hlist.inline ol,.mw-parser-output .hlist.inline ul,.mw-parser-output .hlist dl dl,.mw-parser-output .hlist dl ol,.mw-parser-output .hlist dl ul,.mw-parser-output .hlist ol dl,.mw-parser-output .hlist ol ol,.mw-parser-output .hlist ol ul,.mw-parser-output .hlist ul dl,.mw-parser-output .hlist ul ol,.mw-parser-output .hlist ul ul{display:inline}.mw-parser-output .hlist .mw-empty-li{display:none}.mw-parser-output .hlist dt::after{content:": "}.mw-parser-output .hlist dd::after,.mw-parser-output .hlist li::after{content:" · ";font-weight:bold}.mw-parser-output .hlist dd:last-child::after,.mw-parser-output .hlist dt:last-child::after,.mw-parser-output .hlist li:last-child::after{content:none}.mw-parser-output .hlist dd dd:first-child::before,.mw-parser-output .hlist dd dt:first-child::before,.mw-parser-output .hlist dd li:first-child::before,.mw-parser-output .hlist dt dd:first-child::before,.mw-parser-output .hlist dt dt:first-child::before,.mw-parser-output .hlist dt li:first-child::before,.mw-parser-output .hlist li dd:first-child::before,.mw-parser-output .hlist li dt:first-child::before,.mw-parser-output .hlist li li:first-child::before{content:" (";font-weight:normal}.mw-parser-output .hlist dd dd:last-child::after,.mw-parser-output .hlist dd dt:last-child::after,.mw-parser-output .hlist dd li:last-child::after,.mw-parser-output .hlist dt dd:last-child::after,.mw-parser-output .hlist dt dt:last-child::after,.mw-parser-output .hlist dt li:last-child::after,.mw-parser-output .hlist li dd:last-child::after,.mw-parser-output .hlist li dt:last-child::after,.mw-parser-output .hlist li li:last-child::after{content:")";font-weight:normal}.mw-parser-output .hlist ol{counter-reset:listitem}.mw-parser-output .hlist ol>li{counter-increment:listitem}.mw-parser-output .hlist ol>li::before{content:" "counter(listitem)"\a0 "}.mw-parser-output .hlist dd ol>li:first-child::before,.mw-parser-output .hlist dt ol>li:first-child::before,.mw-parser-output .hlist li ol>li:first-child::before{content:" ("counter(listitem)"\a0 "}
/* end https://en.wikipedia.org/ */
</style><style data-mw-deduplicate="TemplateStyles:r1246091330">
/* start https://en.wikipedia.org/ */
.mw-parser-output .sidebar{width:22em;float:right;clear:right;margin:0.5em 0 1em 1em;background:var(--background-color-neutral-subtle,#f8f9fa);border:1px solid var(--border-color-base,#a2a9b1);padding:0.2em;text-align:center;line-height:1.4em;font-size:88%;border-collapse:collapse;display:table}body.skin-minerva .mw-parser-output .sidebar{display:table!important;float:right!important;margin:0.5em 0 1em 1em!important}.mw-parser-output .sidebar-subgroup{width:100%;margin:0;border-spacing:0}.mw-parser-output .sidebar-left{float:left;clear:left;margin:0.5em 1em 1em 0}.mw-parser-output .sidebar-none{float:none;clear:both;margin:0.5em 1em 1em 0}.mw-parser-output .sidebar-outer-title{padding:0 0.4em 0.2em;font-size:125%;line-height:1.2em;font-weight:bold}.mw-parser-output .sidebar-top-image{padding:0.4em}.mw-parser-output .sidebar-top-caption,.mw-parser-output .sidebar-pretitle-with-top-image,.mw-parser-output .sidebar-caption{padding:0.2em 0.4em 0;line-height:1.2em}.mw-parser-output .sidebar-pretitle{padding:0.4em 0.4em 0;line-height:1.2em}.mw-parser-output .sidebar-title,.mw-parser-output .sidebar-title-with-pretitle{padding:0.2em 0.8em;font-size:145%;line-height:1.2em}.mw-parser-output .sidebar-title-with-pretitle{padding:0.1em 0.4em}.mw-parser-output .sidebar-image{padding:0.2em 0.4em 0.4em}.mw-parser-output .sidebar-heading{padding:0.1em 0.4em}.mw-parser-output .sidebar-content{padding:0 0.5em 0.4em}.mw-parser-output .sidebar-content-with-subgroup{padding:0.1em 0.4em 0.2em}.mw-parser-output .sidebar-above,.mw-parser-output .sidebar-below{padding:0.3em 0.8em;font-weight:bold}.mw-parser-output .sidebar-collapse .sidebar-above,.mw-parser-output .sidebar-collapse .sidebar-below{border-top:1px solid #aaa;border-bottom:1px solid #aaa}.mw-parser-output .sidebar-navbar{text-align:right;font-size:115%;padding:0 0.4em 0.4em}.mw-parser-output .sidebar-list-title{padding:0 0.4em;text-align:left;font-weight:bold;line-height:1.6em;font-size:105%}.mw-parser-output .sidebar-list-title-c{padding:0 0.4em;text-align:center;margin:0 3.3em}@media(max-width:640px){body.mediawiki .mw-parser-output .sidebar{width:100%!important;clear:both;float:none!important;margin-left:0!important;margin-right:0!important}}body.skin--responsive .mw-parser-output .sidebar a>img{max-width:none!important}@media screen{html.skin-theme-clientpref-night .mw-parser-output .sidebar:not(.notheme) .sidebar-list-title,html.skin-theme-clientpref-night .mw-parser-output .sidebar:not(.notheme) .sidebar-title-with-pretitle{background:transparent!important}html.skin-theme-clientpref-night .mw-parser-output .sidebar:not(.notheme) .sidebar-title-with-pretitle a{color:var(--color-progressive)!important}}@media screen and (prefers-color-scheme:dark){html.skin-theme-clientpref-os .mw-parser-output .sidebar:not(.notheme) .sidebar-list-title,html.skin-theme-clientpref-os .mw-parser-output .sidebar:not(.notheme) .sidebar-title-with-pretitle{background:transparent!important}html.skin-theme-clientpref-os .mw-parser-output .sidebar:not(.notheme) .sidebar-title-with-pretitle a{color:var(--color-progressive)!important}}@media print{body.ns-0 .mw-parser-output .sidebar{display:none!important}}
/* end https://en.wikipedia.org/ */
</style><table class="sidebar nomobile nowraplinks"><tbody><tr><th class="sidebar-title"><a href="Data_transformation_(computing)" title="Data transformation (computing)">Data transformation</a></th></tr><tr><th class="sidebar-heading" style="background:#E7C6A5; padding:2px">
Concepts</th></tr><tr><td class="sidebar-content hlist">
<ul><li><a href="Metadata" title="Metadata">Metadata</a></li>
<li><a href="Data_element" title="Data element">Data element</a></li>
<li><a href="Data_mapping" title="Data mapping">Data mapping</a></li>
<li><a href="Data_migration" title="Data migration">Data migration</a></li>
<li><a href="Data_transformation_(computing)" title="Data transformation (computing)">Data transformation</a></li>
<li><a href="Model_transformation" title="Model transformation">Model transformation</a></li>
<li><a href="Macro_(computer_science)" title="Macro (computer science)">Macro</a></li>
</ul></td>
</tr><tr><th class="sidebar-heading" style="background:#E7C6A5; padding:2px">
<a href="Transformation_language" title="Transformation language">Transformation languages</a></th></tr><tr><td class="sidebar-content hlist">
<ul><li><a href="ATLAS_Transformation_Language" title="ATLAS Transformation Language">ATL</a></li>
<li><a href="AWK" title="AWK">AWK</a></li>
<li><a href="MOFM2T" class="mw-redirect" title="MOFM2T">MOFM2T</a></li>
<li><a href="QVT" title="QVT">QVT</a></li>
<li><a href="XML_transformation_language" title="XML transformation language">XML languages</a></li></ul></td>
</tr><tr><th class="sidebar-heading" style="background:#E7C6A5; padding:2px">
Techniques and transforms</th></tr><tr><td class="sidebar-content hlist">
<ul><li><a href="Identity_transform" title="Identity transform">Identity transform</a></li>
<li><a href="Data_refinement" class="mw-redirect" title="Data refinement">Data refinement</a></li></ul></td>
</tr><tr><th class="sidebar-heading" style="background:#E7C6A5; padding:2px">
Applications</th></tr><tr><td class="sidebar-content hlist">
<ul><li><a href="Data_conversion" title="Data conversion">Data conversion</a></li>
<li><a href="Data_migration" title="Data migration">Data migration</a></li>
<li><a href="Data_integration" title="Data integration">Data integration</a></li>
<li><a href="Extract%2C_transform%2C_load" title="Extract, transform, load">Extract, transform, load</a> (ETL)</li>
<li><a href="Web_template_system" title="Web template system">Web template system</a></li></ul></td>
</tr><tr><th class="sidebar-heading" style="background:#E7C6A5; padding:2px">
Related</th></tr><tr><td class="sidebar-content hlist">
<ul><li><a href="Data_wrangling" title="Data wrangling">Data wrangling</a></li>
<li><a href="Transformation_language" title="Transformation language">Transformation languages</a></li></ul></td>
</tr><tr><td class="sidebar-navbar"><style data-mw-deduplicate="TemplateStyles:r1239400231">
/* start https://en.wikipedia.org/ */
.mw-parser-output .navbar{display:inline;font-size:88%;font-weight:normal}.mw-parser-output .navbar-collapse{float:left;text-align:left}.mw-parser-output .navbar-boxtext{word-spacing:0}.mw-parser-output .navbar ul{display:inline-block;white-space:nowrap;line-height:inherit}.mw-parser-output .navbar-brackets::before{margin-right:-0.125em;content:"[ "}.mw-parser-output .navbar-brackets::after{margin-left:-0.125em;content:" ]"}.mw-parser-output .navbar li{word-spacing:-0.125em}.mw-parser-output .navbar a>span,.mw-parser-output .navbar a>abbr{text-decoration:inherit}.mw-parser-output .navbar-mini abbr{font-variant:small-caps;border-bottom:none;text-decoration:none;cursor:inherit}.mw-parser-output .navbar-ct-full{font-size:114%;margin:0 7em}.mw-parser-output .navbar-ct-mini{font-size:114%;margin:0 4em}html.skin-theme-clientpref-night .mw-parser-output .navbar li a abbr{color:var(--color-base)!important}@media(prefers-color-scheme:dark){html.skin-theme-clientpref-os .mw-parser-output .navbar li a abbr{color:var(--color-base)!important}}@media print{.mw-parser-output .navbar{display:none!important}}
/* end https://en.wikipedia.org/ */
</style></td></tr></tbody></table>
<p>In <a href="Computer_science" title="Computer science">computer science</a>, a <b>preprocessor</b> (or <b>precompiler</b>)<sup id="cite_ref-1" class="reference"><a href="#cite_note-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup> is a <a href="Computer_program" title="Computer program">program</a> that processes its input data to produce output that is used as input in another program. The output is said to be a <b>preprocessed</b> form of the input data, which is often used by some subsequent programs like <a href="Compiler" title="Compiler">compilers</a>. The amount and kind of processing done depends on the nature of the preprocessor; some preprocessors are only capable of performing relatively simple textual substitutions and <a href="Macro_(computer_science)" title="Macro (computer science)">macro</a> expansions, while others have the power of full-fledged <a href="Programming_language" title="Programming language">programming languages</a>.
</p><p>A common example from <a href="Computer_programming" title="Computer programming">computer programming</a> is the processing performed on <a href="Source_code" title="Source code">source code</a> before the next step of compilation.
In some <a href="Computer_language" title="Computer language">computer languages</a> (e.g., <a href="C_(programming_language)" title="C (programming language)">C</a> and <a href="PL/I_(programming_language)" class="mw-redirect" title="PL/I (programming language)">PL/I</a>) there is a phase of <a href="Compiler" title="Compiler">translation</a> known as <i>preprocessing</i>. It can also include macro processing, file inclusion and language extensions.
</p>
<meta property="mw:PageProp/toc">
<div class="mw-heading mw-heading2"><h2 id="Lexical_preprocessors">Lexical preprocessors</h2></div>
<p>Lexical preprocessors are the lowest-level of preprocessors as they only require <a href="Lexical_analysis" title="Lexical analysis">lexical analysis</a>, that is, they operate on the source text, prior to any <a href="Parser" class="mw-redirect" title="Parser">parsing</a>, by performing simple substitution of <a href="Lexical_analysis" title="Lexical analysis">tokenized</a> character sequences for other tokenized character sequences, according to user-defined rules. They typically perform <a href="Macro_substitution" class="mw-redirect" title="Macro substitution">macro substitution</a>, <a href="Header_file" class="mw-redirect" title="Header file">textual inclusion</a> of other files, and conditional compilation or inclusion.
</p>
<div class="mw-heading mw-heading3"><h3 id="C_preprocessor">C preprocessor</h3></div>
<style data-mw-deduplicate="TemplateStyles:r1236090951">
/* start https://en.wikipedia.org/ */
.mw-parser-output .hatnote{font-style:italic}.mw-parser-output div.hatnote{padding-left:1.6em;margin-bottom:0.5em}.mw-parser-output .hatnote i{font-style:normal}.mw-parser-output .hatnote+link+.hatnote{margin-top:-0.5em}@media print{body.ns-0 .mw-parser-output .hatnote{display:none!important}}
/* end https://en.wikipedia.org/ */
</style><div role="note" class="hatnote navigation-not-searchable">Main article: <a href="C_preprocessor" title="C preprocessor">C preprocessor</a></div>
<p>The most common example of this is the <a href="C_preprocessor" title="C preprocessor">C preprocessor</a>, which takes lines beginning with '#' as <a href="Directive_(programming)" title="Directive (programming)">directives</a>.
The C preprocessor does not expect its input to use the syntax of the C language.
Some languages take a different approach and use built-in language features to achieve similar things. For example:
</p>
<ul><li>Instead of macros, some languages use aggressive inlining and templates.</li>
<li>Instead of includes, some languages use compile-time imports that rely on type information in the object code.</li>
<li>Some languages use <code>if-then-else</code> and <a href="Dead_code_elimination" class="mw-redirect" title="Dead code elimination">dead code elimination</a> to achieve <a href="Conditional_compilation" title="Conditional compilation">conditional compilation</a>.</li></ul>
<div class="mw-heading mw-heading3"><h3 id="Other_lexical_preprocessors">Other lexical preprocessors</h3></div>
<p>Other lexical preprocessors include the general-purpose <a href="M4_(language)" class="mw-redirect" title="M4 (language)">m4</a>, most commonly used in cross-platform build systems such as <a href="Autoconf" title="Autoconf">autoconf</a>, and <a href="General_purpose_macro_processor" class="mw-redirect" title="General purpose macro processor">GEMA</a>, an open source macro processor which operates on patterns of context.
</p>
<div class="mw-heading mw-heading2"><h2 id="Syntactic_preprocessors">Syntactic preprocessors</h2></div>
<p>Syntactic preprocessors were introduced with the <a href="Lisp_programming_language" class="mw-redirect" title="Lisp programming language">Lisp</a> family of languages. Their role is to transform syntax trees according to a number of user-defined rules. For some programming languages, the rules are written in the same language as the program (compile-time reflection). This is the case with <a href="Lisp_programming_language" class="mw-redirect" title="Lisp programming language">Lisp</a> and <a href="OCaml" title="OCaml">OCaml</a>. Some other languages rely on a fully external language to define the transformations, such as the <a href="XSLT" title="XSLT">XSLT</a> preprocessor for <a href="XML" title="XML">XML</a>, or its statically typed counterpart CDuce.
</p><p>Syntactic preprocessors are typically used to customize the syntax of a language, extend a language by adding new primitives, or embed a <a href="Domain-specific_programming_language" class="mw-redirect" title="Domain-specific programming language">domain-specific programming language</a> (DSL) inside a general purpose language.
</p>
<div class="mw-heading mw-heading3"><h3 id="Customizing_syntax">Customizing syntax</h3></div>
<p>A good example of syntax customization is the existence of two different syntaxes in the <a href="OCaml" title="OCaml">Objective Caml</a> programming language.<sup id="cite_ref-2" class="reference"><a href="#cite_note-2"><span class="cite-bracket">[</span>2<span class="cite-bracket">]</span></a></sup> Programs may be written indifferently using the "normal syntax" or the "revised syntax", and may be pretty-printed with either syntax on demand.
</p><p>Similarly, a number of programs written in <a href="OCaml" title="OCaml">OCaml</a> customize the syntax of the language by the addition of new operators.
</p>
<div class="mw-heading mw-heading3"><h3 id="Extending_a_language">Extending a language</h3></div>
<p>The best examples of language extension through macros are found in the <a href="Lisp_programming_language" class="mw-redirect" title="Lisp programming language">Lisp</a> family of languages. While the languages, by themselves, are simple dynamically typed functional cores, the standard distributions of <a href="Scheme_(programming_language)" title="Scheme (programming language)">Scheme</a> or <a href="Common_Lisp" title="Common Lisp">Common Lisp</a> permit imperative or object-oriented programming, as well as static typing. Almost all of these features are implemented by syntactic preprocessing, although it bears noting that the "macro expansion" phase of compilation is handled by the compiler in Lisp. This can still be considered a form of preprocessing, since it takes place before other phases of compilation.
</p>
<div class="mw-heading mw-heading3"><h3 id="Specializing_a_language">Specializing a language</h3></div>
<p>One of the unusual features of the <a href="Lisp_programming_language" class="mw-redirect" title="Lisp programming language">Lisp</a> family of languages is the possibility of using macros to create an internal DSL. Typically, in a large <a href="Lisp_programming_language" class="mw-redirect" title="Lisp programming language">Lisp</a>-based project, a module may be written in a variety of such <a href="Minilanguage" class="mw-redirect" title="Minilanguage">minilanguages</a>, one perhaps using a <a href="SQL" title="SQL">SQL</a>-based dialect of <a href="Lisp_programming_language" class="mw-redirect" title="Lisp programming language">Lisp</a>, another written in a dialect specialized for <a href="Graphical_user_interface" title="Graphical user interface">GUIs</a> or pretty-printing, etc. <a href="Common_Lisp" title="Common Lisp">Common Lisp</a>'s standard library contains an example of this level of syntactic abstraction in the form of the LOOP macro, which implements an Algol-like minilanguage to describe complex iteration, while still enabling the use of standard Lisp operators.
</p><p>The <a href="MetaOCaml" class="mw-redirect" title="MetaOCaml">MetaOCaml</a> preprocessor/language provides similar features for external DSLs. This preprocessor takes the description of the semantics of a language (i.e. an interpreter) and, by combining compile-time interpretation and code generation, turns that definition into a compiler to the <a href="OCaml" title="OCaml">OCaml</a> programming language—and from that language, either to bytecode or to native code.
</p>
<div class="mw-heading mw-heading2"><h2 id="General_purpose_preprocessor">General purpose preprocessor</h2></div>
<div role="note" class="hatnote navigation-not-searchable">Main article: <a href="General-purpose_macro_processor" title="General-purpose macro processor">General-purpose macro processor</a></div>
<p>Most preprocessors are specific to a particular data processing task (e.g., <a href="Compilers" class="mw-redirect" title="Compilers">compiling</a> the C language). A preprocessor may be promoted as being <i>general purpose</i>, meaning that it is not aimed at a specific usage or programming language, and is intended to be used for a wide variety of text processing tasks.
</p>
<div role="note" class="hatnote navigation-not-searchable">See also: <a href="C_preprocessor#Other_uses" title="C preprocessor">C preprocessor § Other uses</a></div>
<p><a href="M4_(computer_language)" title="M4 (computer language)">M4</a> is probably the most well known example of such a general purpose preprocessor, although the C preprocessor is sometimes used in a non-C specific role. Examples:
</p>
<ul><li>using C preprocessor for <a href="JavaScript" title="JavaScript">JavaScript</a> preprocessing.<sup id="cite_ref-3" class="reference"><a href="#cite_note-3"><span class="cite-bracket">[</span>3<span class="cite-bracket">]</span></a></sup><sup id="cite_ref-4" class="reference"><a href="#cite_note-4"><span class="cite-bracket">[</span>4<span class="cite-bracket">]</span></a></sup></li>
<li>using C preprocessor for <a href="Devicetree" title="Devicetree">devicetree</a> processing within the <a href="Linux_kernel" title="Linux kernel">Linux kernel</a>.<sup id="cite_ref-5" class="reference"><a href="#cite_note-5"><span class="cite-bracket">[</span>5<span class="cite-bracket">]</span></a></sup></li>
<li>using <a href="M4_(computer_language)" title="M4 (computer language)">M4</a> <small>(see on-article example)</small> or C preprocessor<sup id="cite_ref-6" class="reference"><a href="#cite_note-6"><span class="cite-bracket">[</span>6<span class="cite-bracket">]</span></a></sup> as a <a href="Web_template_system" title="Web template system">template engine</a>, to <a href="HTML" title="HTML">HTML</a> generation.</li>
<li><a href="Imake" title="Imake">imake</a>, a <a href="Make_(software)" title="Make (software)">make</a> interface using the C preprocessor, written for the <a href="X_Window_System" title="X Window System">X Window System</a> but now deprecated in favour of <a href="Automake" title="Automake">automake</a>.</li>
<li>grompp, a preprocessor for simulation input files for <a href="GROMACS" title="GROMACS">GROMACS</a> (a fast, free, open-source code for some problems in <a href="Computational_chemistry" title="Computational chemistry">computational chemistry</a>) which calls the system C preprocessor (or other preprocessor as determined by the simulation input file) to parse the topology, using mostly the #define and #include mechanisms to determine the effective topology at grompp run time.</li></ul>
<div class="mw-heading mw-heading2"><h2 id="See_also">See also</h2></div>
<ul><li><a href="Directive_(programming)" title="Directive (programming)">Directive (programming)</a> – Language construct that specifies how a compiler should process its input</li>
<li><a href="Metaprogramming" title="Metaprogramming">Metaprogramming</a> – Programming paradigm</li>
<li><a href="Macro_(computer_science)" title="Macro (computer science)">Macros</a> – Rule for substituting a set input with a set output</li>
<li><a href="Source-to-source_compiler" title="Source-to-source compiler">Source-to-source compiler</a>, also known as Transpiler – Translator of computer source code</li>
<li><a href="Sass_(stylesheet_language)" class="mw-redirect" title="Sass (stylesheet language)">Sass (stylesheet language)</a> – Stylesheet language<span style="display:none" class="category-annotation-with-redirected-description">Pages displaying short descriptions of redirect targets</span></li>
<li><a href="Stylus_(stylesheet_language)" class="mw-redirect" title="Stylus (stylesheet language)">Stylus (stylesheet language)</a> – Stylesheet preprocessor language<span style="display:none" class="category-annotation-with-redirected-description">Pages displaying short descriptions of redirect targets</span></li>
<li><a href="Less_(stylesheet_language)" class="mw-redirect" title="Less (stylesheet language)">Less (stylesheet language)</a> – Dynamic stylesheet language<span style="display:none" class="category-annotation-with-redirected-description">Pages displaying short descriptions of redirect targets</span></li>
<li><a href="Snippet_(programming)" title="Snippet (programming)">Snippet (programming)</a> – Small region of re-usable source code, machine code, or text</li>
<li><a href="Template_processor" title="Template processor">Template engine</a> – Software designed to combine templates with a data model to produce result documents</li>
<li>The <a href="C_preprocessor" title="C preprocessor">C preprocessor</a> – Text processor used with C and C++ and other programming tools</li>
<li>The <a href="Camlp4" title="Camlp4">OCaml preprocessor-pretty-printer</a> – Programming software system</li>
<li>The <a href="PL/I_preprocessor" title="PL/I preprocessor">PL/I preprocessor</a></li>
<li>The <a href="Windows_software_trace_preprocessor" title="Windows software trace preprocessor">Windows software trace preprocessor</a></li>
<li><a href="General-purpose_macro_processor" title="General-purpose macro processor">General-purpose macro processor</a> – Macro processor that is not tied to or integrated with a particular language or piece of software.</li></ul>
<div class="mw-heading mw-heading2"><h2 id="References">References</h2></div>
<style data-mw-deduplicate="TemplateStyles:r1239543626">
/* start https://en.wikipedia.org/ */
.mw-parser-output .reflist{margin-bottom:0.5em;list-style-type:decimal}@media screen{.mw-parser-output .reflist{font-size:90%}}.mw-parser-output .reflist .references{font-size:100%;margin-bottom:0;list-style-type:inherit}.mw-parser-output .reflist-columns-2{column-width:30em}.mw-parser-output .reflist-columns-3{column-width:25em}.mw-parser-output .reflist-columns{margin-top:0.3em}.mw-parser-output .reflist-columns ol{margin-top:0}.mw-parser-output .reflist-columns li{page-break-inside:avoid;break-inside:avoid-column}.mw-parser-output .reflist-upper-alpha{list-style-type:upper-alpha}.mw-parser-output .reflist-upper-roman{list-style-type:upper-roman}.mw-parser-output .reflist-lower-alpha{list-style-type:lower-alpha}.mw-parser-output .reflist-lower-greek{list-style-type:lower-greek}.mw-parser-output .reflist-lower-roman{list-style-type:lower-roman}
/* end https://en.wikipedia.org/ */
</style><div class="reflist">
<div class="mw-references-wrap"><ol class="references">
<li id="cite_note-1"><span class="mw-cite-backlink"><b><a href="#cite_ref-1">^</a></b></span> <span class="reference-text"><style data-mw-deduplicate="TemplateStyles:r1238218222">
/* start https://en.wikipedia.org/ */
.mw-parser-output cite.citation{font-style:inherit;word-wrap:break-word}.mw-parser-output .citation q{quotes:"\"""\"""'""'"}.mw-parser-output .citation:target{background-color:rgba(0,127,255,0.133)}.mw-parser-output .id-lock-free.id-lock-free a{background:url("./mw/Lock-green.svg")right 0.1em center/9px no-repeat}.mw-parser-output .id-lock-limited.id-lock-limited a,.mw-parser-output .id-lock-registration.id-lock-registration a{background:url("./mw/Lock-gray-alt-2.svg")right 0.1em center/9px no-repeat}.mw-parser-output .id-lock-subscription.id-lock-subscription a{background:url("./mw/Lock-red-alt-2.svg")right 0.1em center/9px no-repeat}.mw-parser-output .cs1-ws-icon a{background:url("./mw/Wikisource-logo.svg")right 0.1em center/12px no-repeat}body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-free a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-limited a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-registration a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-subscription a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .cs1-ws-icon a{background-size:contain;padding:0 1em 0 0}.mw-parser-output .cs1-code{color:inherit;background:inherit;border:none;padding:inherit}.mw-parser-output .cs1-hidden-error{display:none;color:var(--color-error,#d33)}.mw-parser-output .cs1-visible-error{color:var(--color-error,#d33)}.mw-parser-output .cs1-maint{display:none;color:#085;margin-left:0.3em}.mw-parser-output .cs1-kern-left{padding-left:0.2em}.mw-parser-output .cs1-kern-right{padding-right:0.2em}.mw-parser-output .citation .mw-selflink{font-weight:inherit}@media screen{.mw-parser-output .cs1-format{font-size:95%}html.skin-theme-clientpref-night .mw-parser-output .cs1-maint{color:#18911f}}@media screen and (prefers-color-scheme:dark){html.skin-theme-clientpref-os .mw-parser-output .cs1-maint{color:#18911f}}
/* end https://en.wikipedia.org/ */
</style><cite class="citation web cs1"><a rel="nofollow" class="external text" href="https://www.ibm.com/docs/zosbasics/com.ibm.zos.zappldev/zappldev_111.htm">"What is a precompiler?"</a>. <i><a href="IBM" title="IBM">IBM</a></i>.</cite></span>
</li>
<li id="cite_note-2"><span class="mw-cite-backlink"><b><a href="#cite_ref-2">^</a></b></span> <span class="reference-text"><a rel="nofollow" class="external text" href="http://caml.inria.fr/pub/docs/manual-camlp4/manual007.html">The Revised syntax</a> from The Caml language website</span>
</li>
<li id="cite_note-3"><span class="mw-cite-backlink"><b><a href="#cite_ref-3">^</a></b></span> <span class="reference-text">Show how to use <a href="C_preprocessor" title="C preprocessor">C-preprocessor</a> on JavaScript files. <a rel="nofollow" class="external text" href="https://web.archive.org/web/20080116034428/http://blog.inetoffice.com/?p=12">"JavaScript is Not Industrial Strength"</a> <i>by T. Snyder</i>.</span>
</li>
<li id="cite_note-4"><span class="mw-cite-backlink"><b><a href="#cite_ref-4">^</a></b></span> <span class="reference-text"><cite class="citation web cs1"><a rel="nofollow" class="external text" href="http://www.nongnu.org/espresso/js-cpp.html">"The C Preprocessor in Javascript?"</a>. <i>espresso-mode</i>.</cite></span>
</li>
<li id="cite_note-5"><span class="mw-cite-backlink"><b><a href="#cite_ref-5">^</a></b></span> <span class="reference-text"><cite class="citation web cs1"><a rel="nofollow" class="external text" href="https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git/commit/?id=b40b25fff8205dd18124d8fc87b2c9c57f269b5f">"Kernel/Git/Stable/Linux.git - Linux kernel stable tree"</a>.</cite></span>
</li>
<li id="cite_note-6"><span class="mw-cite-backlink"><b><a href="#cite_ref-6">^</a></b></span> <span class="reference-text">Show how to use <a href="C_preprocessor" title="C preprocessor">C-preprocessor</a> as <a href="Template_processor" title="Template processor">template engine</a>.
<a rel="nofollow" class="external text" href="https://jkorpela.fi/html/cpre.html">"Using a C preprocessor as an HTML authoring tool"</a> <i>by J. Korpela</i>, 2000.</span>
</li>
</ol></div></div>
<div class="mw-heading mw-heading2"><h2 id="External_links">External links</h2></div>
<style data-mw-deduplicate="TemplateStyles:r1290876196">
/* start https://en.wikipedia.org/ */
.mw-parser-output .side-box{margin:4px 0;box-sizing:border-box;border:1px solid #aaa;font-size:88%;line-height:1.25em;background-color:var(--background-color-interactive-subtle,#f8f9fa);display:flow-root}.mw-parser-output .infobox .side-box{font-size:100%}.mw-parser-output .side-box-abovebelow,.mw-parser-output .side-box-text{padding:0.25em 0.9em}.mw-parser-output .side-box-image{padding:2px 0 2px 0.9em;text-align:center}.mw-parser-output .side-box-imageright{padding:2px 0.9em 2px 0;text-align:center}@media(min-width:500px){.mw-parser-output .side-box-flex{display:flex;align-items:center}.mw-parser-output .side-box-text{flex:1;min-width:0}}@media(min-width:720px){.mw-parser-output .side-box{width:238px}.mw-parser-output .side-box-right{clear:right;float:right;margin-left:1em}.mw-parser-output .side-box-left{margin-right:1em}}
/* end https://en.wikipedia.org/ */
</style><style data-mw-deduplicate="TemplateStyles:r1237033735">
/* start https://en.wikipedia.org/ */
@media print{body.ns-0 .mw-parser-output .sistersitebox{display:none!important}}@media screen{html.skin-theme-clientpref-night .mw-parser-output .sistersitebox img[src*="Wiktionary-logo-en-v2.svg"]{background-color:white}}@media screen and (prefers-color-scheme:dark){html.skin-theme-clientpref-os .mw-parser-output .sistersitebox img[src*="Wiktionary-logo-en-v2.svg"]{background-color:white}}
/* end https://en.wikipedia.org/ */
</style><div class="side-box side-box-right sistersitebox"><style data-mw-deduplicate="TemplateStyles:r1126788409">
/* start https://en.wikipedia.org/ */
.mw-parser-output .plainlist ol,.mw-parser-output .plainlist ul{line-height:inherit;list-style:none;margin:0;padding:0}.mw-parser-output .plainlist ol li,.mw-parser-output .plainlist ul li{margin-bottom:0}
/* end https://en.wikipedia.org/ */
</style>
<div class="side-box-flex">
<div class="side-box-image"><span class="noviewer" typeof="mw:File"></span></div>
<div class="side-box-text plainlist">Look up <i><b><a href="https://en.wiktionary.org/wiki/preprocessor" class="extiw external" title="wiktionary:preprocessor">preprocessor</a></b></i> in Wiktionary, the free dictionary.</div></div>
</div>
<ul><li><a rel="nofollow" class="external text" href="https://web.archive.org/web/20090214092527/http://lispm.dyndns.org/news?ID=NEWS-2005-07-08-1">DSL Design in Lisp</a></li>
<li><a rel="nofollow" class="external text" href="http://www.paulgraham.com/progbot.html">Programming from the bottom up</a></li>
<li>The <a rel="nofollow" class="external text" href="https://logological.org/gpp">Generic PreProcessor</a></li>
<li>Gema, the <a rel="nofollow" class="external text" href="http://gema.sourceforge.net">General Purpose Macro Processor</a></li>
<li>The PIKT <a rel="nofollow" class="external text" href="http://pikt.org/pikt/ref/ref.4.piktc.html">piktc</a> <a rel="nofollow" class="external text" href="http://pikt.org/pikt/ref/ref.3.html">text, script, and configuration file preprocessor</a></li>
<li><a rel="nofollow" class="external text" href="https://goetzpf.bitbucket.io/pyexpander">pyexpander, a python based general purpose macro processor</a></li>
<li><a rel="nofollow" class="external text" href="http://freshmeat.net/projects/minimac-macro-processor">minimac, a minimalist macro processor</a></li>
<li><a rel="nofollow" class="external text" href="https://github.com/raydac/java-comment-preprocessor">Java Comment Preprocessor</a></li></ul>
<div class="navbox-styles"><style data-mw-deduplicate="TemplateStyles:r1236075235">
/* start https://en.wikipedia.org/ */
.mw-parser-output .navbox{box-sizing:border-box;border:1px solid #a2a9b1;width:100%;clear:both;font-size:88%;text-align:center;padding:1px;margin:1em auto 0}.mw-parser-output .navbox .navbox{margin-top:0}.mw-parser-output .navbox+.navbox,.mw-parser-output .navbox+.navbox-styles+.navbox{margin-top:-1px}.mw-parser-output .navbox-inner,.mw-parser-output .navbox-subgroup{width:100%}.mw-parser-output .navbox-group,.mw-parser-output .navbox-title,.mw-parser-output .navbox-abovebelow{padding:0.25em 1em;line-height:1.5em;text-align:center}.mw-parser-output .navbox-group{white-space:nowrap;text-align:right}.mw-parser-output .navbox,.mw-parser-output .navbox-subgroup{background-color:#fdfdfd}.mw-parser-output .navbox-list{line-height:1.5em;border-color:#fdfdfd}.mw-parser-output .navbox-list-with-group{text-align:left;border-left-width:2px;border-left-style:solid}.mw-parser-output tr+tr>.navbox-abovebelow,.mw-parser-output tr+tr>.navbox-group,.mw-parser-output tr+tr>.navbox-image,.mw-parser-output tr+tr>.navbox-list{border-top:2px solid #fdfdfd}.mw-parser-output .navbox-title{background-color:#ccf}.mw-parser-output .navbox-abovebelow,.mw-parser-output .navbox-group,.mw-parser-output .navbox-subgroup .navbox-title{background-color:#ddf}.mw-parser-output .navbox-subgroup .navbox-group,.mw-parser-output .navbox-subgroup .navbox-abovebelow{background-color:#e6e6ff}.mw-parser-output .navbox-even{background-color:#f7f7f7}.mw-parser-output .navbox-odd{background-color:transparent}.mw-parser-output .navbox .hlist td dl,.mw-parser-output .navbox .hlist td ol,.mw-parser-output .navbox .hlist td ul,.mw-parser-output .navbox td.hlist dl,.mw-parser-output .navbox td.hlist ol,.mw-parser-output .navbox td.hlist ul{padding:0.125em 0}.mw-parser-output .navbox .navbar{display:block;font-size:100%}.mw-parser-output .navbox-title .navbar{float:left;text-align:left;margin-right:0.5em}body.skin--responsive .mw-parser-output .navbox-image img{max-width:none!important}@media print{body.ns-0 .mw-parser-output .navbox{display:none!important}}
/* end https://en.wikipedia.org/ */
</style><style data-mw-deduplicate="TemplateStyles:r1038841319">
/* start https://en.wikipedia.org/ */
.mw-parser-output .tooltip-dotted{border-bottom:1px dotted;cursor:help}
/* end https://en.wikipedia.org/ */
</style></div><div role="navigation" class="navbox authority-control" aria-label="Navbox674" style="padding:3px"><table class="nowraplinks hlist navbox-inner" style="border-spacing:0;background:transparent;color:inherit"><tbody><tr><th scope="row" class="navbox-group" style="width:1%">Authority control databases: National </th><td class="navbox-list-with-group navbox-list navbox-odd" style="width:100%;padding:0"><div style="padding:0 0.25em"><ul><li><span class="uid"><a rel="nofollow" class="external text" href="https://d-nb.info/gnd/4544347-6">Germany</a></span></li><li><span class="uid"><span class="rt-commentedText tooltip tooltip-dotted" title="preprocesory"><a rel="nofollow" class="external text" href="https://aleph.nkp.cz/F/?func=find-c&local_base=aut&ccl_term=ica=ph507305&CON_LNG=ENG">Czech Republic</a></span></span></li></ul></div></td></tr></tbody></table></div></div><!--htdig_noindex--><div><div class="zim-footer">
This article is issued from <a class="external text" title="Last edited on 2024-10-14" href="https://en.wikipedia.org/wiki/?title=Preprocessor&oldid=1251149061">Wikipedia</a>. The text is available under <a class="external text" href="https://creativecommons.org/licenses/by-sa/4.0/deed.en">Creative Commons Attribution-Share Alike 4.0</a> unless otherwise noted. Additional terms may apply for the media files.
</div>
</div><!--/htdig_noindex--></div>
</div>
</main>
</div>
</div>
</div>
</body></html>